#include <iostream>
#include <pthread.h>
#include <string>
#include <vector>
#include <unistd.h>
#include <thread>

void threadRun(std::string name, int num)
{
    while(num)
    {
        std::cout << name << " num: " << num << std::endl;
        num--;
        sleep(1);
    }
}

int main()
{
    std::thread mythead(threadRun, "thread-1", 10);

    while(true)
    {
        std::cout << "main thread..." << std::endl;
        sleep(1);
        break;
    }
    mythead.join();
    return 0;
}